import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueJsx(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    //配置代理跨域
    proxy: {
      '/api': {
        // target: 'http://b653ux.natappfree.cc/assistant',
        target: 'http://localhost:9001/assistant',
        changeOrigin: true,//允许跨域
        ws: false
      },
    },
  }
})
